package com.hera.process.config.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hera.base.util.FiltroDTO;
import com.hera.process.config.dao.ParameterDao;
import com.hera.process.config.dao.UserDao;
import com.hera.process.config.service.UserService;
import com.hera.process.security.domain.User;



@Service("userService")
public class UserServiceImpl implements UserService{

	static final Logger logger = Logger.getLogger(UserServiceImpl.class);

	@Autowired
	private UserDao userDao;
	/**
	 * 
	 */
	public UserServiceImpl() {
		
	}
	
	
	@Override
	public User findById(Long id) {
		
		return userDao.findOne(id);
	}

	@Override
	public void update(User entity) {
		
		userDao.save(entity);
		
	}

	@Override
	public void save(User entity) {
		
		userDao.save(entity);
	}

	@Override
	public void delete(User entity) {
		
		userDao.delete(entity);
	}

	@Override
	public List<User> findAll() {
		
		return userDao.findAll();
	}

	@Override
	public List<User> findAll(FiltroDTO filtroDTO) {
		
		return userDao.obtenerEntidadesPorFiltros(filtroDTO);
	}



}
